package com.itzhoun;

/**
 * @author 周楠
 * @Date 2023/01/15/上午 10:45
 */
public abstract class Drink {

    //Drink是抽象构件


    private String desc;

    private float price = 0.0f;


    public String getDesc() {
        return desc;
    }

    public void setDesc(String desc) {
        this.desc = desc;
    }

    public float getPrice() {
        return price;
    }

    public void setPrice(float price) {
        this.price = price;
    }

    @Override
    public String toString() {
        return "Drink{" +
                "desc='" + desc + '\'' +
                ", price=" + price +
                '}';
    }

    /**
     * 计算费用方法，交给子类实现
     * @return
     */
    public abstract float cost();
}
